<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
use Hyperf\DbConnection\Db;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('attraction_type', function (Blueprint $table) {
            $table->comment('分类表');
            $table->bigIncrements('id');
            $table->tinyInteger('type')->nullable(false)->comment('类型0:点位，1:信息');
            $table->string('name', 64)->nullable(false)->comment('分类名称');
            $table->string('description', 255)->nullable(true)->default('')->comment('分类描述');
            $table->integer('sort')->nullable(false)->default(100)->comment('排序');
            $table->integer('parent_id')->nullable(false)->default(0)->comment('父级分类Id');
            $table->integer('level')->nullable(false)->default(1)->comment('分类层级');
            $table->datetimes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('attraction_type');
    }

};
